﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Knlght.ObjectFactory.Core;

namespace Knlght.Service
{
    /// <summary>
    /// 程序设置上下文
    /// </summary>
    public class SettingManager
    {
        #region 初始化
        private static SettingManager instance = null;
        private ISettingApi _api = null;
        private static object async = new object();
        private SettingManager()
        {
            _api = Knlght.ObjectFactory.ObjectFactory.Get<ISettingApi>();
        }
        public static ISettingApi Current
        {
            get
            {
                if (instance == null)
                {
                    lock (async)
                    {
                        if (instance == null)
                        {
                            instance = new SettingManager();
                        }
                    }
                }
                return instance._api;
            }
        }
        #endregion
    }
}
